*************************************************************************************************************************************************************
*************************************************************************************************************************************************************
***This .do file generates Estimates_for_plots.dta, which is used for the generation of all plots in the paper***********************************************
***Do not split the file: files names over-ride each other, and estimates for all programs should be saved sequentially**************************************
*************************************************************************************************************************************************************
*************************************************************************************************************************************************************




clear all

use "Estimation Sample.dta" 

set more off

xtset id2



preserve 

egen cmt=group(country month treataf)

*********************************************
***AUSTRIA, 2009, UNIT SALES, SUBSIDIZED
*********************************************
quietly reghdfe dlogunits i.presub6af9##ib1.treataf i.presub5af9##ib1.treataf i.presub4af9##ib1.treataf i.presub3af9##ib1.treataf i.presub2af9##ib1.treataf i.presub1af9##ib1.treataf i.sub1af9##ib1.treataf i.sub2af9##ib1.treataf i.sub3af9##ib1.treataf i.sub4af9##ib1.treataf i.postsub1af9##ib1.treataf i.postsub2af9##ib1.treataf i.postsub3af9##ib1.treataf i.postsub4af9##ib1.treataf i.postsub5af9##ib1.treataf i.postsub6af9##ib1.treataf mage mage2 , absorb(id2 cmt) cluster(id) 

est store subu
		
    	nlcom _b[1.presub6af9]-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)		
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)			
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post 
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)		
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)		
				
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s12
		parmest, format(estimate min95 max95) saving("s12.dta", replace) 	idstr(5)		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s13
		parmest, format(estimate min95 max95) saving("s13.dta", replace) 	idstr(6)
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s14
		parmest, format(estimate min95 max95) saving("s14.dta", replace) 	idstr(7)	
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s15
		parmest, format(estimate min95 max95) saving("s15.dta", replace) 	idstr(8)
		
est restore subu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9]+_b[1.postsub6af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store s16
		parmest, format(estimate min95 max95) saving("s16.dta", replace) 	idstr(9)	
		
est restore subu
		
lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])		

clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"
		append using "s10.dta"
		append using "s11.dta"
		append using "s12.dta"
		append using "s13.dta"
		append using "s14.dta"
		append using "s15.dta"
		append using "s16.dta"
		
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	

preserve
	
***AUSTRIA, 2009, UNIT SALES, NON-SUBSIDIZED

egen cmt=group(country month treataf)

quietly reghdfe dlogunits i.presub6af9##i.treataf i.presub5af9##i.treataf i.presub4af9##i.treataf i.presub3af9##i.treataf i.presub2af9##i.treataf i.presub1af9##i.treataf i.sub1af9##i.treataf i.sub2af9##i.treataf i.sub3af9##i.treataf i.sub4af9##i.treataf i.postsub1af9##i.treataf i.postsub2af9##i.treataf i.postsub3af9##i.treataf i.postsub4af9##i.treataf i.postsub5af9##i.treataf i.postsub6af9##i.treataf  mage mage2 , absorb(id2 cmt) cluster(id)
est store nonsubu

    	nlcom _b[1.presub6af9]-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)		
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)			
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post 
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns9
		parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)		
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns11
		parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)		
				
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns12
		parmest, format(estimate min95 max95) saving("ns12.dta", replace) 	idstr(5)		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns13
		parmest, format(estimate min95 max95) saving("ns13.dta", replace) 	idstr(6)
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns14
		parmest, format(estimate min95 max95) saving("ns14.dta", replace) 	idstr(7)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns15
		parmest, format(estimate min95 max95) saving("ns15.dta", replace) 	idstr(8)
		
est restore nonsubu	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9]+_b[1.postsub6af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store ns16
		parmest, format(estimate min95 max95) saving("ns16.dta", replace) 	idstr(9)			
		
*est restore nonsubu
		
*lincom  (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])

clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		append using "ns9.dta"
		append using "ns10.dta"
		append using "ns11.dta"
		append using "ns12.dta"
		append using "ns13.dta"
		append using "ns14.dta"
		append using "ns15.dta"
		append using "ns16.dta"
		
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	

		
	
preserve				
***AUSTRIA, 2009, PRICES, SUBSIDIZED

egen cmt=group(country month treataf)

quietly reghdfe dlogunits i.presub6af9##ib1.treataf i.presub5af9##ib1.treataf i.presub4af9##ib1.treataf i.presub3af9##ib1.treataf i.presub2af9##ib1.treataf i.presub1af9##ib1.treataf i.sub1af9##ib1.treataf i.sub2af9##ib1.treataf i.sub3af9##ib1.treataf i.sub4af9##ib1.treataf i.postsub1af9##ib1.treataf i.postsub2af9##ib1.treataf i.postsub3af9##ib1.treataf i.postsub4af9##ib1.treataf i.postsub5af9##ib1.treataf i.postsub6af9##ib1.treataf  mage mage2 , absorb(id2 cmt) cluster(id) 
generate samples = e(sample)

quietly reghdfe dlogprice i.presub6af9##ib1.treataf i.presub5af9##ib1.treataf i.presub4af9##ib1.treataf i.presub3af9##ib1.treataf i.presub2af9##ib1.treataf i.presub1af9##ib1.treataf i.sub1af9##ib1.treataf i.sub2af9##ib1.treataf i.sub3af9##ib1.treataf i.sub4af9##ib1.treataf i.postsub1af9##ib1.treataf i.postsub2af9##ib1.treataf i.postsub3af9##ib1.treataf i.postsub4af9##ib1.treataf i.postsub5af9##ib1.treataf i.postsub6af9##ib1.treataf mage mage2 if samples , absorb(id2 cmt) cluster(id)
		est store subp
		
		nlcom _b[1.presub6af9]-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp3
		parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)		
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)	
		
est restore subp
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)			
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp6
		parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)	
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post 
		est store sp7
		parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)
		
est restore subp
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)	
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)	
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)		
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)		
				
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp12
		parmest, format(estimate min95 max95) saving("sp12.dta", replace) 	idstr(5)		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp13
		parmest, format(estimate min95 max95) saving("sp13.dta", replace) 	idstr(6)
		
est restore subp
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp14
		parmest, format(estimate min95 max95) saving("sp14.dta", replace) 	idstr(7)	
		
est restore subp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp15
		parmest, format(estimate min95 max95) saving("sp15.dta", replace) 	idstr(8)
		
est restore subp
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9]+_b[1.postsub6af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store sp16
		parmest, format(estimate min95 max95) saving("sp16.dta", replace) 	idstr(9)	
		
*est restore subp		
		
*lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])

*lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9]+_b[1.postsub6af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])



clear all
		
		use "sp1.dta"
		append using "sp2.dta"
		append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		append using "sp6.dta"
		append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"
		append using "sp10.dta"
		append using "sp11.dta"
		append using "sp12.dta"
		append using "sp13.dta"
		append using "sp14.dta"
		append using "sp15.dta"
		append using "sp16.dta"
		
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	

preserve		

***AUSTRIA, 2009, PRICES, NON-SUBSIDIZED

egen cmt=group(country month treataf)

quietly reghdfe dlogunits i.presub6af9##ib1.treataf i.presub5af9##ib1.treataf i.presub4af9##ib1.treataf i.presub3af9##ib1.treataf i.presub2af9##ib1.treataf i.presub1af9##ib1.treataf i.sub1af9##ib1.treataf i.sub2af9##ib1.treataf i.sub3af9##ib1.treataf i.sub4af9##ib1.treataf i.postsub1af9##ib1.treataf i.postsub2af9##ib1.treataf i.postsub3af9##ib1.treataf i.postsub4af9##ib1.treataf i.postsub5af9##ib1.treataf i.postsub6af9##ib1.treataf mage mage2 , absorb(id2 cmt) cluster(id) 
generate samples = e(sample)

quietly reghdfe dlogprice i.presub6af9##i.treataf i.presub5af9##i.treataf i.presub4af9##i.treataf i.presub3af9##i.treataf i.presub2af9##i.treataf i.presub1af9##i.treataf i.sub1af9##i.treataf i.sub2af9##i.treataf i.sub3af9##i.treataf i.sub4af9##i.treataf i.postsub1af9##i.treataf i.postsub2af9##i.treataf i.postsub3af9##i.treataf i.postsub4af9##i.treataf i.postsub5af9##i.treataf  i.postsub6af9##i.treataf   mage mage2 if samples , absorb(id2 cmt) cluster(id)
est store nonsubp

    	nlcom _b[1.presub6af9]-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)		
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)	
		
est restore nonsubp	
		*nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		*est store nsp5
		*parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)			
		
*est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)	
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post 
		est store nsp7
		parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)
		
est restore nonsubp	
		*nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		*est store nsp8
		*parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)	
		
*est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)	
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)		
		
est restore nonsubp	
		*nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		*est store nsp11
		*parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)		
				
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp12
		parmest, format(estimate min95 max95) saving("nsp12.dta", replace) 	idstr(5)		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp13
		parmest, format(estimate min95 max95) saving("nsp13.dta", replace) 	idstr(6)
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp14
		parmest, format(estimate min95 max95) saving("nsp14.dta", replace) 	idstr(7)	
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp15
		parmest, format(estimate min95 max95) saving("nsp15.dta", replace) 	idstr(8)
		
est restore nonsubp	
		nlcom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9]+_b[1.postsub2af9]+_b[1.postsub3af9]+_b[1.postsub4af9]+_b[1.postsub5af9]+_b[1.postsub6af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]), post
		est store nsp16
		parmest, format(estimate min95 max95) saving("nsp16.dta", replace) 	idstr(9)	

est restore nonsubp
	
lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])

lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])

lincom (_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9]+_b[1.presub2af9]+_b[1.presub1af9]+_b[1.sub1af9]+_b[1.sub2af9]+_b[1.sub3af9]+_b[1.sub4af9]+_b[1.postsub1af9])-(_b[1.presub6af9]+_b[1.presub5af9]+_b[1.presub4af9]+_b[1.presub3af9])

clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		*append using "nsp5.dta"
		append using "nsp6.dta"
		append using "nsp7.dta"
		*append using "nsp8.dta"
		append using "nsp9.dta"
		append using "nsp10.dta"
		*append using "nsp11.dta"
		append using "nsp12.dta"
		append using "nsp13.dta"
		append using "nsp14.dta"
		append using "nsp15.dta"
		append using "nsp16.dta"
		
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve

clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
		gen program="at09"
		save "AT_2009_Coeff_6.dta", replace
restore


preserve 

egen cmt=group(country month treataf)

*********************************************
***AUSTRIA, 2010, FF UNIT SALES, SUBSIDIZED
*********************************************
quietly reghdfe dlogunits i.presub6af10##ib1.treataf i.presub5af10##ib1.treataf i.presub4af10##ib1.treataf i.presub3af10##ib1.treataf i.presub2af10##ib1.treataf i.presub1af10##ib1.treataf i.sub1af10##ib1.treataf i.sub2af10##ib1.treataf i.sub3af10##ib1.treataf i.postsub1af10##ib1.treataf i.postsub2af10##ib1.treataf i.postsub3af10##ib1.treataf i.postsub4af10##ib1.treataf  i.postsub5af10##ib1.treataf  i.postsub6af10##ib1.treataf mage mage2 , absorb(id2 cmt) cluster(id)
est store subu

		nlcom _b[1.presub6af10]-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu	
		nlcom (_b[1.presub6af10]+_b[1.presub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)
		
est restore subu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)
		
est restore subu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)
				
est restore subu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)
				
est restore subu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)
											
est restore subu	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)
				  
est restore subu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)	
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)
		
est restore subu	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s12
		parmest, format(estimate min95 max95) saving("s12.dta", replace) 	idstr(5)	
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s13
		parmest, format(estimate min95 max95) saving("s13.dta", replace) 	idstr(6)		
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s14
		parmest, format(estimate min95 max95) saving("s14.dta", replace) 	idstr(7)		
		
est restore subu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10]+_b[1.postsub6af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store s15
		parmest, format(estimate min95 max95) saving("s15.dta", replace) 	idstr(8)		
		
*est restore subu

*lincom _b[1.presub6af10]-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10])
		
		
clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"
		append using "s10.dta"
		append using "s11.dta"
		append using "s12.dta"
		append using "s13.dta"
		append using "s14.dta"
		append using "s15.dta"
		
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	

preserve

***AUSTRIA, 2010, FF, UNIT SALES, NON-SUBSIDIZED

egen cmt=group(country month treataf)


quietly reghdfe dlogunits i.presub6af10##i.treataf i.presub5af10##i.treataf i.presub4af10##i.treataf i.presub3af10##i.treataf i.presub2af10##i.treataf i.presub1af10##i.treataf i.sub1af10##i.treataf i.sub2af10##i.treataf i.sub3af10##i.treataf i.postsub1af10##i.treataf i.postsub2af10##i.treataf i.postsub3af10##i.treataf i.postsub4af10##i.treataf i.postsub5af10##i.treataf i.postsub6af10##i.treataf mage mage2 , absorb(id2 cmt) cluster(id)
est store nonsubu

		nlcom _b[1.presub6af10]-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu	
		nlcom (_b[1.presub6af10]+_b[1.presub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)
		
est restore nonsubu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)
		
est restore nonsubu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)
				
est restore nonsubu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)
				
est restore nonsubu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)
												
est restore nonsubu	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)
				  
est restore nonsubu	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns9
		parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)	
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)
		
est restore nonsubu	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns11
		parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns12
		parmest, format(estimate min95 max95) saving("ns12.dta", replace) 	idstr(5)	
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns13
		parmest, format(estimate min95 max95) saving("ns13.dta", replace) 	idstr(6)		
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns14
		parmest, format(estimate min95 max95) saving("ns14.dta", replace) 	idstr(7)		
		
est restore nonsubu	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10]+_b[1.postsub6af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store ns15
		parmest, format(estimate min95 max95) saving("ns15.dta", replace) 	idstr(8)		
		

		
		
clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		append using "ns9.dta"
		append using "ns10.dta"
		append using "ns11.dta"
		append using "ns12.dta"
		append using "ns13.dta"
		append using "ns14.dta"
		append using "ns15.dta"
		
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	


preserve

***AUSTRIA, 2010, FF, PRICES, SUBSIDIZED

egen cmt=group(country month treataf)

quietly reghdfe dlogunits i.presub6af10##ib1.treataf i.presub5af10##ib1.treataf i.presub4af10##ib1.treataf i.presub3af10##ib1.treataf i.presub2af10##ib1.treataf i.presub1af10##ib1.treataf i.sub1af10##ib1.treataf i.sub2af10##ib1.treataf i.sub3af10##ib1.treataf i.postsub1af10##ib1.treataf i.postsub2af10##ib1.treataf i.postsub3af10##ib1.treataf i.postsub4af10##ib1.treataf i.postsub5af10##ib1.treataf i.postsub6af10##ib1.treataf mage mage2 , absorb(id2 cmt) cluster(id)
generate samples = e(sample)

	
quietly reghdfe dlogprice i.presub6af10##ib1.treataf i.presub5af10##ib1.treataf i.presub4af10##ib1.treataf i.presub3af10##ib1.treataf i.presub2af10##ib1.treataf i.presub1af10##ib1.treataf i.sub1af10##ib1.treataf i.sub2af10##ib1.treataf i.sub3af10##ib1.treataf i.postsub1af10##ib1.treataf i.postsub2af10##ib1.treataf i.postsub3af10##ib1.treataf i.postsub4af10##ib1.treataf i.postsub5af10##ib1.treataf i.postsub6af10##ib1.treataf  mage mage2 if samples, absorb(id2 cmt) cluster(id)
est store subp

		nlcom _b[1.presub6af10]-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp	
		nlcom (_b[1.presub6af10]+_b[1.presub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)
		
est restore subp	
		nlcom (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp3
		parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)
		
est restore subp
		nlcom (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)
				
est restore subp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)
				
est restore subp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp6
		parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)
											
est restore subp	
		*nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		*est store sp7
		*parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)
				  
est restore subp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)
		
est restore subp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)	
		
est restore subp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)
		
est restore subp	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)
		
est restore subp
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp12
		parmest, format(estimate min95 max95) saving("sp12.dta", replace) 	idstr(5)	
		
est restore subp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp13
		parmest, format(estimate min95 max95) saving("sp13.dta", replace) 	idstr(6)		
		
est restore subp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp14
		parmest, format(estimate min95 max95) saving("sp14.dta", replace) 	idstr(7)		
		
est restore subp
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10]+_b[1.postsub6af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store sp15
		parmest, format(estimate min95 max95) saving("sp15.dta", replace) 	idstr(8)		
		
est restore subp

lincom (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])
		
		
clear all
		
		use "sp1.dta"
		append using "sp2.dta"
		append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		append using "sp6.dta"
		*append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"
		append using "sp10.dta"
		append using "sp11.dta"
		append using "sp12.dta"
		append using "sp13.dta"
		append using "sp14.dta"
		append using "sp15.dta"
		
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	


preserve

***AUSTRIA, 2010, FF, PRICES, NON-SUBSIDIZED

egen cmt=group(country month treataf)

quietly reghdfe dlogunits i.presub6af10##ib1.treataf i.presub5af10##ib1.treataf i.presub4af10##ib1.treataf i.presub3af10##ib1.treataf i.presub2af10##ib1.treataf i.presub1af10##ib1.treataf i.sub1af10##ib1.treataf i.sub2af10##ib1.treataf i.sub3af10##ib1.treataf i.postsub1af10##ib1.treataf i.postsub2af10##ib1.treataf i.postsub3af10##ib1.treataf i.postsub4af10##ib1.treataf i.postsub5af10##ib1.treataf  i.postsub6af10##ib1.treataf mage mage2 , absorb(id2 cmt) cluster(id)
generate samples = e(sample)

quietly reghdfe dlogprice i.presub6af10##i.treataf i.presub5af10##i.treataf i.presub4af10##i.treataf i.presub3af10##i.treataf i.presub2af10##i.treataf i.presub1af10##i.treataf i.sub1af10##i.treataf i.sub2af10##i.treataf i.sub3af10##i.treataf i.postsub1af10##i.treataf i.postsub2af10##i.treataf i.postsub3af10##i.treataf i.postsub4af10##i.treataf i.postsub5af10##i.treataf i.postsub6af10##i.treataf mage mage2 if samples, absorb(id2 cmt) cluster(id)
est store nonsubp	

	nlcom _b[1.presub6af10]-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp	
		nlcom (_b[1.presub6af10]+_b[1.presub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)
		
est restore nonsubp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)
		
est restore nonsubp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)
				
est restore nonsubp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp5
		parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)
				
est restore nonsubp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)
												
est restore nonsubp	
		*nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		*est store nsp7
		*parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)
				  
*est restore nonsubp	
		nlcom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp8
		parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)
		
est restore nonsubp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)	
		
est restore nonsubp
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)
		
est restore nonsubp	
		nlcom   (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp11
		parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)
		
est restore nonsubp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp12
		parmest, format(estimate min95 max95) saving("nsp12.dta", replace) 	idstr(5)	
		
est restore nonsubp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp13
		parmest, format(estimate min95 max95) saving("nsp13.dta", replace) 	idstr(6)		
		
est restore nonsubp	
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp14
		parmest, format(estimate min95 max95) saving("nsp14.dta", replace) 	idstr(7)		
		
est restore nonsubp
		nlcom    (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10]+_b[1.sub2af10]+_b[1.sub3af10]+_b[1.postsub1af10]+_b[1.postsub2af10]+_b[1.postsub3af10]+_b[1.postsub4af10]+_b[1.postsub5af10]+_b[1.postsub6af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]), post
		est store nsp15
		parmest, format(estimate min95 max95) saving("nsp15.dta", replace) 	idstr(8)	
		
est restore nonsubp		
		
lincom  (_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10]+_b[1.presub2af10]+_b[1.presub1af10]+_b[1.sub1af10])-(_b[1.presub6af10]+_b[1.presub5af10]+_b[1.presub4af10]+_b[1.presub3af10])
		
		
clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		append using "nsp5.dta"
		append using "nsp6.dta"
		*append using "nsp7.dta"
		append using "nsp8.dta"
		append using "nsp9.dta"
		append using "nsp10.dta"
		append using "nsp11.dta"
		append using "nsp12.dta"
		append using "nsp13.dta"
		append using "nsp14.dta"
		append using "nsp15.dta"
		
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve

clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
		gen program="at10ff"
		save "AT_2010_ff_Coeff_6.dta", replace
restore


preserve 

egen cmt=group(country month treata)

********************************************
***AUSTRIA, 2010, WM UNIT SALES, SUBSIDIZED
********************************************
quietly reghdfe dlogunits i.presub6a##ib1.treata i.presub5a##ib1.treata i.presub4a##ib1.treata  i.presub3a##ib1.treata i.presub2a##ib1.treata i.presub1a##ib1.treata i.sub1a##ib1.treata i.sub2a##ib1.treata i.postsub1a##ib1.treata i.postsub2a##ib1.treata i.postsub3a##ib1.treata i.postsub4a##ib1.treata i.postsub5a##ib1.treata i.postsub6a##ib1.treata  mage mage2 , absorb(id2 cmt) cluster(id) 
est store subu 

		nlcom _b[1.presub6a]-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)				
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)	
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s12
		parmest, format(estimate min95 max95) saving("s12.dta", replace) 	idstr(5)
		
est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s13
		parmest, format(estimate min95 max95) saving("s13.dta", replace) 	idstr(6)
		
	est restore subu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a]+_b[1.postsub6a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store s14
		parmest, format(estimate min95 max95) saving("s14.dta", replace) 	idstr(7)
		
*est restore subu

*lincom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])
		clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"
		append using "s10.dta"
		append using "s11.dta"
		append using "s12.dta"
		append using "s13.dta"
		append using "s14.dta"
		
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	
		
preserve 

egen cmt=group(country month treata)


***AUSTRIA, 2010, WM UNIT SALES, NON-SUBSIDIZED		
quietly reghdfe dlogunits i.presub6a##i.treata i.presub5a##i.treata i.presub4a##i.treata i.presub3a##i.treata i.presub2a##i.treata i.presub1a##i.treata i.sub1a##i.treata i.sub2a##i.treata  i.postsub1a##i.treata i.postsub2a##i.treata i.postsub3a##i.treata i.postsub4a##i.treata i.postsub5a##i.treata i.postsub6a##i.treata mage mage2 , absorb(id2 cmt) cluster(id)
est store nonsubu

		nlcom _b[1.presub6a]-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)				
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)	
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns9
		parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns11
		parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns12
		parmest, format(estimate min95 max95) saving("ns12.dta", replace) 	idstr(5)
		
est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns13
		parmest, format(estimate min95 max95) saving("ns13.dta", replace) 	idstr(6)
		
	est restore nonsubu		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a]+_b[1.postsub6a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store ns14
		parmest, format(estimate min95 max95) saving("ns14.dta", replace) 	idstr(7)
		clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		append using "ns9.dta"
		append using "ns10.dta"
		append using "ns11.dta"
		append using "ns12.dta"
		append using "ns13.dta"
		append using "ns14.dta"
		
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	

preserve 

egen cmt=group(country month treata)


***AUSTRIA, 2010, WM PRICES, SUBSIDIZED		
quietly reghdfe dlogunits i.presub6a##ib1.treata i.presub5a##ib1.treata i.presub4a##ib1.treata i.presub3a##ib1.treata i.presub2a##ib1.treata i.presub1a##ib1.treata i.sub1a##ib1.treata i.sub2a##ib1.treata i.postsub1a##ib1.treata i.postsub2a##ib1.treata i.postsub3a##ib1.treata  i.postsub4a##ib1.treata i.postsub5a##ib1.treata i.postsub6a##ib1.treata mage mage2 , absorb(id2 cmt) cluster(id) 
generate samples = e(sample)

quietly reghdfe dlogprice i.presub6a##ib1.treata i.presub5a##ib1.treata i.presub4a##ib1.treata i.presub3a##ib1.treata i.presub2a##ib1.treata i.presub1a##ib1.treata i.sub1a##ib1.treata i.sub2a##ib1.treata i.postsub1a##ib1.treata i.postsub2a##ib1.treata i.postsub3a##ib1.treata i.postsub4a##ib1.treata i.postsub5a##ib1.treata i.postsub6a##ib1.treata mage mage2 if samples, absorb(id2 cmt) cluster(id)
est store subp	

		nlcom _b[1.presub6a]-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp3
		parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp6
		parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)				
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp7
		parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)	
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)
		
est restore subp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp12
		parmest, format(estimate min95 max95) saving("sp12.dta", replace) 	idstr(5)
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp13
		parmest, format(estimate min95 max95) saving("sp13.dta", replace) 	idstr(6)
		
est restore subp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a]+_b[1.postsub6a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store sp14
		parmest, format(estimate min95 max95) saving("sp14.dta", replace) 	idstr(7)
		
*lincom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a]+_b[1.postsub6a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a])

		clear all
		
		use "sp1.dta"
		append using "sp2.dta"
		append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		append using "sp6.dta"
		append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"
		append using "sp10.dta"
		append using "sp11.dta"
		append using "sp12.dta"
		append using "sp13.dta"
		append using "sp14.dta"
		
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	
		

preserve 

egen cmt=group(country month treata)


***AUSTRIA, 2010, WM PRICES, NON-SUBSIDIZED	
quietly reghdfe dlogunits i.presub6a##ib1.treata i.presub5a##ib1.treata i.presub4a##ib1.treata i.presub3a##ib1.treata i.presub2a##ib1.treata i.presub1a##ib1.treata i.sub1a##ib1.treata i.sub2a##ib1.treata i.postsub1a##ib1.treata i.postsub2a##ib1.treata i.postsub3a##ib1.treata i.postsub4a##ib1.treata i.postsub5a##ib1.treata i.postsub6a##ib1.treata mage mage2 , absorb(id2 cmt) cluster(id) 
generate samples = e(sample)

quietly reghdfe dlogprice i.presub6a##i.treata i.presub5a##i.treata i.presub4a##i.treata i.presub3a##i.treata i.presub2a##i.treata i.presub1a##i.treata i.sub1a##i.treata i.sub2a##i.treata i.postsub1a##i.treata i.postsub2a##i.treata i.postsub3a##i.treata  i.postsub4a##i.treata i.postsub5a##i.treata i.postsub6a##i.treata mage mage2 , absorb(id2 cmt) cluster(id)
est store nonsubp

		nlcom _b[1.presub6a]-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)	
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)	
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)	
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp5
		parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)	
		
est restore nonsubp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)				
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp7
		parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)	
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp8
		parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)
		
est restore nonsubp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp11
		parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp12
		parmest, format(estimate min95 max95) saving("nsp12.dta", replace) 	idstr(5)
		
est restore nonsubp	
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp13
		parmest, format(estimate min95 max95) saving("nsp13.dta", replace) 	idstr(6)
		
est restore nonsubp		
		nlcom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a]+_b[1.sub2a]+_b[1.postsub1a]+_b[1.postsub2a]+_b[1.postsub3a]+_b[1.postsub4a]+_b[1.postsub5a]+_b[1.postsub6a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]), post
		est store nsp14
		parmest, format(estimate min95 max95) saving("nsp14.dta", replace) 	idstr(7)
		
*est restore nonsubp		

*lincom (_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a]+_b[1.sub1a])-(_b[1.presub6a]+_b[1.presub5a]+_b[1.presub4a]+_b[1.presub3a]+_b[1.presub2a]+_b[1.presub1a])
		
		clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		append using "nsp5.dta"
		append using "nsp6.dta"
		append using "nsp7.dta"
		append using "nsp8.dta"
		append using "nsp9.dta"
		append using "nsp10.dta"
		append using "nsp11.dta"
		append using "nsp12.dta"
		append using "nsp13.dta"
		append using "nsp14.dta"
		
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve

clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
		gen program="at10wm"
		save "AT_2010_wm_Coeff_6.dta", replace
restore


tab energy_label_eu
encode energy_label_eu, gen(label)

xtset id2


preserve

egen cmt=group(country month treath)


***HUNGARY, 2015, UNIT SALES, SUBSIDIZED
quietly reghdfe dlogunits i.presub6h##ib1.treath i.presub5h##ib1.treath i.presub4h##ib1.treath i.presub3h##ib1.treath i.presub2h##ib1.treath i.presub1h##ib1.treath i.sub1h##ib1.treath i.sub2h##ib1.treath i.sub3h##ib1.treath i.sub4h##ib1.treath i.postsub1h##ib1.treath i.postsub2h##ib1.treath i.postsub3h##ib1.treath i.postsub4h##ib1.treath i.postsub5h##ib1.treath i.postsub6h##ib1.treath mage mage2  if country!="Croatia", absorb(id2 cmt) cluster(id) 
est store subu

		nlcom _b[1.presub6h]-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu
		nlcom (_b[1.presub6h]+_b[1.presub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)
		
est restore subu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)	
		
est restore subu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)	
		
est restore subu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)
		
est restore subu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)	
						
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)	
		
est restore subu
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)		
		
est restore subu
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)		

est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)

est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)		
	
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s12
		parmest, format(estimate min95 max95) saving("s12.dta", replace) 	idstr(5)		
	
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s13
		parmest, format(estimate min95 max95) saving("s13.dta", replace) 	idstr(6)	
		
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s14
		parmest, format(estimate min95 max95) saving("s14.dta", replace) 	idstr(7)			
	
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s15
		parmest, format(estimate min95 max95) saving("s15.dta", replace) 	idstr(8)			
			
est restore subu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h]+_b[1.postsub6h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store s16
		parmest, format(estimate min95 max95) saving("s16.dta", replace) 	idstr(9)			
	
*est restore subu	

*lincom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])

*lincom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])

*lincom 		(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h]+_b[1.postsub6h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])

	clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"
		append using "s10.dta"
	    append using "s11.dta"
	    append using "s12.dta"
	    append using "s13.dta"
		append using "s14.dta"
		append using "s15.dta"
		append using "s16.dta"
		
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	

preserve	
	
egen cmt=group(country month treath)


***HUNGARY, 2015, UNIT SALES, NON-SUBSIDIZED		

quietly reghdfe dlogunits i.presub6h##i.treath i.presub5h##i.treath i.presub4h##i.treath i.presub3h##i.treath i.presub2h##i.treath i.presub1h##i.treath i.sub1h##i.treath i.sub2h##i.treath i.sub3h##i.treath i.sub4h##i.treath i.postsub1h##i.treath i.postsub2h##i.treath i.postsub3h##i.treath i.postsub4h##i.treath i.postsub5h##i.treath i.postsub6h##i.treath mage mage2  if country!="Croatia", absorb(id2 cmt) cluster(id)
est store nonsubu

		nlcom _b[1.presub6h]-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu
		nlcom (_b[1.presub6h]+_b[1.presub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)
		
est restore nonsubu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)	
		
est restore nonsubu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)	
		
est restore nonsubu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)
		
est restore nonsubu
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)	
						
est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)	
		
est restore nonsubu
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)		
		
est restore nonsubu
		*nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		*est store ns9
		*parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)		

*est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)

est restore nonsubu
		*nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		*est store ns11
		*parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)		
	
est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns12
		parmest, format(estimate min95 max95) saving("ns12.dta", replace) 	idstr(5)		
	
est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns13
		parmest, format(estimate min95 max95) saving("ns13.dta", replace) 	idstr(6)	
		
est restore nonsubu
		*nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		*est store ns14
		*parmest, format(estimate min95 max95) saving("ns14.dta", replace) 	idstr(7)			
	
est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns15
		parmest, format(estimate min95 max95) saving("ns15.dta", replace) 	idstr(8)			
			
est restore nonsubu
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h]+_b[1.postsub6h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store ns16
		parmest, format(estimate min95 max95) saving("ns16.dta", replace) 	idstr(9)			
	
est restore nonsubu
 lincom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])
 lincom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])
 lincom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])

	clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		*append using "ns9.dta"
		append using "ns10.dta"
	    *append using "ns11.dta"
	    append using "ns12.dta"
	    append using "ns13.dta"
		*append using "ns14.dta"
		append using "ns15.dta"
		append using "ns16.dta"
		
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	

preserve	
	
egen cmt=group(country month treath)


***HUNGARY, 2015, PRICES, SUBSIDIZED		
quietly reghdfe dlogunits i.presub6h##ib1.treath i.presub5h##ib1.treath i.presub4h##ib1.treath i.presub3h##ib1.treath i.presub2h##ib1.treath i.presub1h##ib1.treath i.sub1h##ib1.treath i.sub2h##ib1.treath i.sub3h##ib1.treath i.sub4h##ib1.treath i.postsub1h##ib1.treath i.postsub2h##ib1.treath i.postsub3h##ib1.treath i.postsub4h##ib1.treath i.postsub5h##ib1.treath i.postsub6h##ib1.treath mage mage2  if country!="Croatia", absorb(id2 cmt) cluster(id) 
generate samples=e(sample)
		
quietly reghdfe dlogprice i.presub6h##ib1.treath i.presub5h##ib1.treath i.presub4h##ib1.treath i.presub3h##ib1.treath i.presub2h##ib1.treath i.presub1h##ib1.treath i.sub1h##ib1.treath i.sub2h##ib1.treath i.sub3h##ib1.treath i.sub4h##ib1.treath i.postsub1h##ib1.treath i.postsub2h##ib1.treath i.postsub3h##ib1.treath i.postsub4h##ib1.treath  i.postsub5h##ib1.treath i.postsub6h##ib1.treath mage mage2  if country!="Croatia" & samples, absorb(id2 cmt) cluster(id)		
est store subp
	
		nlcom _b[1.presub6h]-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp
		nlcom (_b[1.presub6h]+_b[1.presub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)
		
est restore subp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp3
		parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)	
		
est restore subp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)	
		
est restore subp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)
		
est restore subp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp6
		parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)	
						
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp7
		parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)	
		
est restore subp
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)		
		
est restore subp
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)		

est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)

est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)		
	
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp12
		parmest, format(estimate min95 max95) saving("sp12.dta", replace) 	idstr(5)		
	
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp13
		parmest, format(estimate min95 max95) saving("sp13.dta", replace) 	idstr(6)	
		
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp14
		parmest, format(estimate min95 max95) saving("sp14.dta", replace) 	idstr(7)			
	
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp15
		parmest, format(estimate min95 max95) saving("sp15.dta", replace) 	idstr(8)			
			
est restore subp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h]+_b[1.postsub6h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store sp16
		parmest, format(estimate min95 max95) saving("sp16.dta", replace) 	idstr(9)			
	
	

	clear all
		
		use "sp1.dta"
		append using "sp2.dta"
		append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		append using "sp6.dta"
		append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"
		append using "sp10.dta"
	    append using "sp11.dta"
	    append using "sp12.dta"
	    append using "sp13.dta"
		append using "sp14.dta"
		append using "sp15.dta"
		append using "sp16.dta"
		
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	

preserve	
	
egen cmt=group(country month treath)
	
***HUNGARY, 2015, PRICES, NON-SUBSIDIZED		   
quietly reghdfe dlogunits i.presub6h##ib1.treath i.presub5h##ib1.treath i.presub4h##ib1.treath i.presub3h##ib1.treath i.presub2h##ib1.treath i.presub1h##ib1.treath i.sub1h##ib1.treath i.sub2h##ib1.treath i.sub3h##ib1.treath i.sub4h##ib1.treath i.postsub1h##ib1.treath i.postsub2h##ib1.treath i.postsub3h##ib1.treath i.postsub4h##ib1.treath i.postsub5h##ib1.treath i.postsub6h##ib1.treath mage mage2  if country!="Croatia", absorb(id2 cmt) cluster(id) 
generate samples=e(sample)	

quietly reghdfe dlogprice i.presub6h##i.treath i.presub5h##i.treath i.presub4h##i.treath i.presub3h##i.treath i.presub2h##i.treath i.presub1h##i.treath i.sub1h##i.treath i.sub2h##i.treath i.sub3h##i.treath i.sub4h##i.treath i.postsub1h##i.treath i.postsub2h##i.treath i.postsub3h##i.treath  i.postsub4h##i.treath i.postsub5h##i.treath  i.postsub6h##i.treath mage mage2  if country!="Croatia" & samples, absorb(id2 cmt) cluster(id)
est store nonsubp

	nlcom _b[1.presub6h]-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp
		nlcom (_b[1.presub6h]+_b[1.presub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)
		
est restore nonsubp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)	
		
est restore nonsubp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)	
		
est restore nonsubp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp5
		parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)
		
est restore nonsubp
		nlcom (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)	
						
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp7
		parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)	
		
est restore nonsubp
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp8
		parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)		
		
est restore nonsubp
		nlcom   (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)		

est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)

est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp11
		parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)		
	
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp12
		parmest, format(estimate min95 max95) saving("nsp12.dta", replace) 	idstr(5)		
	
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp13
		parmest, format(estimate min95 max95) saving("nsp13.dta", replace) 	idstr(6)	
		
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp14
		parmest, format(estimate min95 max95) saving("nsp14.dta", replace) 	idstr(7)			
	
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp15
		parmest, format(estimate min95 max95) saving("nsp15.dta", replace) 	idstr(8)			
			
est restore nonsubp
		nlcom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h]+_b[1.sub4h]+_b[1.postsub1h]+_b[1.postsub2h]+_b[1.postsub3h]+_b[1.postsub4h]+_b[1.postsub5h]+_b[1.postsub6h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]), post
		est store nsp16
		parmest, format(estimate min95 max95) saving("nsp16.dta", replace) 	idstr(9)			
	
*est restore nonsubp	

*lincom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])

*lincom  (_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h]+_b[1.sub1h]+_b[1.sub2h]+_b[1.sub3h])-(_b[1.presub6h]+_b[1.presub5h]+_b[1.presub4h]+_b[1.presub3h]+_b[1.presub2h]+_b[1.presub1h])
	clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		append using "nsp5.dta"
		append using "nsp6.dta"
		append using "nsp7.dta"
		append using "nsp8.dta"
		append using "nsp9.dta"
		append using "nsp10.dta"
	    append using "nsp11.dta"
	    append using "nsp12.dta"
	    append using "nsp13.dta"
		append using "nsp14.dta"
		append using "nsp15.dta"
		append using "nsp16.dta"
		
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve

clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
	
		gen program="hu15"
		save "HU_2015_Coeff_6.dta", replace
restore

	
	

preserve

egen cmt=group(country month treathf)
egen cmlt=group(country month energy_label_eu treathf)


***HUNGARY, 2016, UNIT SALES, SUBSIDIZED
quietly reghdfe dlogunits i.presub6hf##ib1.treathf i.presub5hf##ib1.treathf i.presub4hf##ib1.treathf i.presub3hf##ib1.treathf i.presub2hf##ib1.treathf i.presub1hf##ib1.treathf i.sub1hf##ib1.treathf i.sub2hf##ib1.treathf i.sub3hf##ib1.treathf i.sub4hf##ib1.treathf i.postsub1hf##ib1.treathf  mage mage2 , absorb(id2 cmt) cluster(id)
est store subu

    	nlcom _b[1.presub6hf]-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)
    
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)		

est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)	
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)			
		
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)			
	
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)	
	
est restore subu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf]+_b[1.postsub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)	
		
*est restore subu

*lincom 	(_b[1.presub6hf]+_b[1.presub5hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])

*lincom  (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])

*lincom  (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])

*lincom  (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])
	
		clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"
		append using "s10.dta"
		append using "s11.dta"
		
	
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	

preserve
egen cmt=group(country month treathf)
egen cmlt=group(country month energy_label_eu treathf)

		
**HUNGARY, 2016, UNIT SALES, N0N-SUBSIDIZED
quietly reghdfe dlogunits i.presub6hf##i.treathf i.presub5hf##i.treathf i.presub4hf##i.treathf i.presub3hf##i.treathf i.presub2hf##i.treathf i.presub1hf##i.treathf i.sub1hf##i.treathf i.sub2hf##i.treathf i.sub3hf##i.treathf i.sub4hf##i.treathf i.postsub1hf##i.treathf  mage mage2 , absorb(id2 cmt) cluster(id)
est store nonsubu

     	nlcom _b[1.presub6hf]-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)
    
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)		

est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)	
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)			
		
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns9
		parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)			
	
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)	
	
est restore nonsubu		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf]+_b[1.postsub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store ns11
		parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)	
		
*est restore nonsubu

*lincom 	(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])	
	
		clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		append using "ns9.dta"
		append using "ns10.dta"
		append using "ns11.dta"
		
	
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	

preserve
egen cmt=group(country month treathf)
egen cmlt=group(country month energy_label_eu treathf)

***HUNGARY, 2016, PRICES, SUBSIDIZED		
			

quietly reghdfe dlogunits i.presub6hf##ib1.treathf i.presub5hf##ib1.treathf i.presub4hf##ib1.treathf i.presub3hf##ib1.treathf i.presub2hf##ib1.treathf i.presub1hf##ib1.treathf i.sub1hf##ib1.treathf i.sub2hf##ib1.treathf i.sub3hf##ib1.treathf i.sub4hf##ib1.treathf i.postsub1hf##ib1.treathf  mage mage2 , absorb(id2 cmt) cluster(id)
generate samples=e(sample)	

quietly reghdfe dlogprice i.presub6hf##ib1.treathf i.presub5hf##ib1.treathf i.presub4hf##ib1.treathf i.presub3hf##ib1.treathf i.presub2hf##ib1.treathf i.presub1hf##ib1.treathf i.sub1hf##ib1.treathf i.sub2hf##ib1.treathf i.sub3hf##ib1.treathf i.sub4hf##ib1.treathf i.postsub1hf##ib1.treathf  mage mage2  if  samples, absorb(id2 cmt) cluster(id)
est store subp

       	nlcom _b[1.presub6hf]-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)
    
est restore subp		
		*nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		*est store sp3
		*parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)
		
*est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)
		
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)
		
est restore subp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp6
		parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)		

est restore subp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp7
		parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)	
		
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)			
		
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)			
	
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)	
	
est restore subp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf]+_b[1.postsub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)	
		
est restore subp		
lincom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf])
	
		clear all
		
		
		
		use "sp1.dta"
		append using "sp2.dta"
		*append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		append using "sp6.dta"
		append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"
		append using "sp10.dta"
		append using "sp11.dta"
		
	
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	

preserve
egen cmt=group(country month treathf)
egen cmlt=group(country month energy_label_eu treathf)

***HUNGARY, 2016, PRICES, NON-SUBSIDIZED	
	
quietly reghdfe dlogunits i.presub6hf##ib1.treathf i.presub5hf##ib1.treathf i.presub4hf##ib1.treathf i.presub3hf##ib1.treathf i.presub2hf##ib1.treathf i.presub1hf##ib1.treathf i.sub1hf##ib1.treathf i.sub2hf##ib1.treathf i.sub3hf##ib1.treathf i.sub4hf##ib1.treathf i.postsub1hf##ib1.treathf  mage mage2 , absorb(id2 cmt) cluster(id)
generate samples=e(sample)

quietly reghdfe dlogprice i.presub6hf##i.treathf i.presub5hf##i.treathf i.presub4hf##i.treathf i.presub3hf##i.treathf i.presub2hf##i.treathf i.presub1hf##i.treathf i.sub1hf##i.treathf i.sub2hf##i.treathf i.sub3hf##i.treathf i.sub4hf##i.treathf i.postsub1hf##i.treathf  mage mage2  if  samples, absorb(id2 cmt) cluster(id)
est store nonsubp			
	
    	nlcom _b[1.presub6hf]-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)
    
est restore nonsubp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)
		
est restore nonsubp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)
		
est restore nonsubp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp5
		parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)
		
est restore nonsubp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)		

est restore nonsubp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp7
		parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)	
		
est restore nonsubp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp8
		parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)			
		
est restore nonsubp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)			
	
est restore nonsubp		
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)	
	
est restore nonsubp	
		nlcom (_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]+_b[1.presub2hf]+_b[1.presub1hf]+_b[1.sub1hf]+_b[1.sub2hf]+_b[1.sub3hf]+_b[1.sub4hf]+_b[1.postsub1hf])-(_b[1.presub6hf]+_b[1.presub5hf]+_b[1.presub4hf]+_b[1.presub3hf]), post
		est store nsp11
		parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)	
	
		clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		append using "nsp5.dta"
		append using "nsp6.dta"
		append using "nsp7.dta"
		append using "nsp8.dta"
		append using "nsp9.dta"
		append using "nsp10.dta"
		append using "nsp11.dta"
		
	
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve

clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
	

		gen program="hu16"
		save "HU_2016_Coeff_6.dta", replace
restore		

preserve 

***CROATIA, 2015, UNIT SALES, SUBSIDIZED, WM


egen cmt=group(country month treatc)
keep if category=="washing machine"

quietly reghdfe dlogunits i.presub6c##ib1.treatc i.presub5c##ib1.treatc i.presub4c##ib1.treatc i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc i.postsub8c##ib1.treatc i.postsub9c##ib1.treatc i.postsub10c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store subu

		nlcom _b[1.presub6c]-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s1
		parmest, format(estimate min95 max95) saving("s1.dta", replace) 	idstr(-6)	
		
est restore subu	
		nlcom (_b[1.presub6c]+_b[1.presub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s2
		parmest, format(estimate min95 max95) saving("s2.dta", replace) 	idstr(-5)	
	
est restore subu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s3
		parmest, format(estimate min95 max95) saving("s3.dta", replace) 	idstr(-4)	
		
est restore subu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s4
		parmest, format(estimate min95 max95) saving("s4.dta", replace) 	idstr(-3)
		
est restore subu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s5
		parmest, format(estimate min95 max95) saving("s5.dta", replace) 	idstr(-2)
		
est restore subu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s6
		parmest, format(estimate min95 max95) saving("s6.dta", replace) 	idstr(-1)		
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s7
		parmest, format(estimate min95 max95) saving("s7.dta", replace) 	idstr(0)		
	
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s8
		parmest, format(estimate min95 max95) saving("s8.dta", replace) 	idstr(1)		
	
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s9
		parmest, format(estimate min95 max95) saving("s9.dta", replace) 	idstr(2)		
	
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s10
		parmest, format(estimate min95 max95) saving("s10.dta", replace) 	idstr(3)	
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s11
		parmest, format(estimate min95 max95) saving("s11.dta", replace) 	idstr(4)
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s12
		parmest, format(estimate min95 max95) saving("s12.dta", replace) 	idstr(5)	
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s13
		parmest, format(estimate min95 max95) saving("s13.dta", replace) 	idstr(6)
	
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s14
		parmest, format(estimate min95 max95) saving("s14.dta", replace) 	idstr(7)
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s15
		parmest, format(estimate min95 max95) saving("s15.dta", replace) 	idstr(8)
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s16
		parmest, format(estimate min95 max95) saving("s16.dta", replace) 	idstr(9)
		
est restore subu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c]+_b[1.postsub10c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store s17
		parmest, format(estimate min95 max95) saving("s17.dta", replace) 	idstr(10)
						
*est restore subu	
*lincom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])
	
*lincom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c]+_b[1.postsub10c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])
		
	
		
		clear all
		
		use "s1.dta"
		append using "s2.dta"
		append using "s3.dta"
		append using "s4.dta"
		append using "s5.dta"
		append using "s6.dta"
		append using "s7.dta"
		append using "s8.dta"
		append using "s9.dta"	
	    append using "s10.dta"
		append using "s11.dta"
		append using "s12.dta"
		append using "s13.dta"
		append using "s14.dta"
		append using "s15.dta"
		append using "s16.dta"
		append using "s17.dta"
		
		gen type="s"
		gen label="all"
		drop z p parm
		rename idstr month
		save "s_6.dta", replace
	
restore	

preserve 

***CROATIA, 2015, UNIT SALES, NON-SUBSIDIZED, WM


egen cmt=group(country month treatc)
keep if category=="washing machine"

quietly reghdfe dlogunits i.presub6c##i.treatc i.presub5c##i.treatc i.presub4c##i.treatc i.presub3c##i.treatc i.presub2c##i.treatc i.presub1c##i.treatc i.sub1c##i.treatc i.postsub1c##i.treatc i.postsub2c##i.treatc i.postsub3c##i.treatc i.postsub4c##i.treatc i.postsub5c##i.treatc i.postsub6c##i.treatc i.postsub7c##i.treatc i.postsub8c##i.treatc i.postsub9c##i.treatc i.postsub10c##i.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store nonsubu


	nlcom _b[1.presub6c]-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns1
		parmest, format(estimate min95 max95) saving("ns1.dta", replace) 	idstr(-6)	
		
est restore nonsubu	
		nlcom (_b[1.presub6c]+_b[1.presub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns2
		parmest, format(estimate min95 max95) saving("ns2.dta", replace) 	idstr(-5)	
	
est restore nonsubu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns3
		parmest, format(estimate min95 max95) saving("ns3.dta", replace) 	idstr(-4)	
		
est restore nonsubu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns4
		parmest, format(estimate min95 max95) saving("ns4.dta", replace) 	idstr(-3)
		
est restore nonsubu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns5
		parmest, format(estimate min95 max95) saving("ns5.dta", replace) 	idstr(-2)
		
est restore nonsubu	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns6
		parmest, format(estimate min95 max95) saving("ns6.dta", replace) 	idstr(-1)		
		
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns7
		parmest, format(estimate min95 max95) saving("ns7.dta", replace) 	idstr(0)		
	
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns8
		parmest, format(estimate min95 max95) saving("ns8.dta", replace) 	idstr(1)		
	
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns9
		parmest, format(estimate min95 max95) saving("ns9.dta", replace) 	idstr(2)		
	
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns10
		parmest, format(estimate min95 max95) saving("ns10.dta", replace) 	idstr(3)	
		
est restore nonsubu	
		*nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		*est store ns11
		*parmest, format(estimate min95 max95) saving("ns11.dta", replace) 	idstr(4)
		
*est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns12
		parmest, format(estimate min95 max95) saving("ns12.dta", replace) 	idstr(5)	
		
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns13
		parmest, format(estimate min95 max95) saving("ns13.dta", replace) 	idstr(6)
	
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns14
		parmest, format(estimate min95 max95) saving("ns14.dta", replace) 	idstr(7)
		
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns15
		parmest, format(estimate min95 max95) saving("ns15.dta", replace) 	idstr(8)
		
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns16
		parmest, format(estimate min95 max95) saving("ns16.dta", replace) 	idstr(9)
		
est restore nonsubu	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c]+_b[1.postsub10c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store ns17
		parmest, format(estimate min95 max95) saving("ns17.dta", replace) 	idstr(10)
						
est restore nonsubu	
lincom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])

*lincom 	(_b[1.presub6c]+_b[1.presub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])	
		
*lincom	(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])

*lincom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])
		
		clear all
		
		use "ns1.dta"
		append using "ns2.dta"
		append using "ns3.dta"
		append using "ns4.dta"
		append using "ns5.dta"
		append using "ns6.dta"
		append using "ns7.dta"
		append using "ns8.dta"
		append using "ns9.dta"	
	    append using "ns10.dta"
		*append using "ns11.dta"
		append using "ns12.dta"
		append using "ns13.dta"
		append using "ns14.dta"
		append using "ns15.dta"
		append using "ns16.dta"
		append using "ns17.dta"
		
		gen type="ns"
		gen label="all"
		drop z p parm
		rename idstr month
		save "ns_6.dta", replace
	
restore	

preserve 

***CROATIA, 2015, PRICES, SUBSIDIZED, WM


egen cmt=group(country month treatc)
keep if category=="washing machine"

quietly reghdfe dlogunits i.presub6c##ib1.treatc i.presub5c##ib1.treatc i.presub4c##ib1.treatc i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc i.postsub7c##ib1.treatc i.postsub8c##ib1.treatc i.postsub9c##ib1.treatc i.postsub10c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
gen samples=e(sample)


quietly reghdfe dlogprice i.presub6c##ib1.treatc i.presub5c##ib1.treatc i.presub4c##ib1.treatc i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc i.postsub7c##ib1.treatc i.postsub8c##ib1.treatc i.postsub9c##ib1.treatc i.postsub10c##ib1.treatc mage mage2  if country!="Hungary" & samples , absorb (id2 cmt) cluster(id)
est store subp

		nlcom _b[1.presub6c]-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp1
		parmest, format(estimate min95 max95) saving("sp1.dta", replace) 	idstr(-6)	
		
est restore subp	
		nlcom (_b[1.presub6c]+_b[1.presub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp2
		parmest, format(estimate min95 max95) saving("sp2.dta", replace) 	idstr(-5)	
	
est restore subp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp3
		parmest, format(estimate min95 max95) saving("sp3.dta", replace) 	idstr(-4)	
		
est restore subp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp4
		parmest, format(estimate min95 max95) saving("sp4.dta", replace) 	idstr(-3)
		
est restore subp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp5
		parmest, format(estimate min95 max95) saving("sp5.dta", replace) 	idstr(-2)
		
est restore subp	
		*nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		*est store sp6
		*parmest, format(estimate min95 max95) saving("sp6.dta", replace) 	idstr(-1)		
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp7
		parmest, format(estimate min95 max95) saving("sp7.dta", replace) 	idstr(0)		
	
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp8
		parmest, format(estimate min95 max95) saving("sp8.dta", replace) 	idstr(1)		
	
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp9
		parmest, format(estimate min95 max95) saving("sp9.dta", replace) 	idstr(2)		
	
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp10
		parmest, format(estimate min95 max95) saving("sp10.dta", replace) 	idstr(3)	
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp11
		parmest, format(estimate min95 max95) saving("sp11.dta", replace) 	idstr(4)
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp12
		parmest, format(estimate min95 max95) saving("sp12.dta", replace) 	idstr(5)	
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp13
		parmest, format(estimate min95 max95) saving("sp13.dta", replace) 	idstr(6)
	
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp14
		parmest, format(estimate min95 max95) saving("sp14.dta", replace) 	idstr(7)
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp15
		parmest, format(estimate min95 max95) saving("sp15.dta", replace) 	idstr(8)
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp16
		parmest, format(estimate min95 max95) saving("sp16.dta", replace) 	idstr(9)
		
est restore subp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c]+_b[1.postsub10c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store sp17
		parmest, format(estimate min95 max95) saving("sp17.dta", replace) 	idstr(10)
						
est restore subp		
	lincom 	(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])
	
		
		clear all
		
		use "sp1.dta"
		append using "sp2.dta"
		append using "sp3.dta"
		append using "sp4.dta"
		append using "sp5.dta"
		*append using "sp6.dta"
		append using "sp7.dta"
		append using "sp8.dta"
		append using "sp9.dta"	
	    append using "sp10.dta"
		append using "sp11.dta"
		append using "sp12.dta"
		append using "sp13.dta"
		append using "sp14.dta"
		append using "sp15.dta"
		append using "sp16.dta"
		append using "sp17.dta"
		
		gen type="sp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "sp_6.dta", replace
	
restore	

preserve 

***CROATIA, 2015, PRICES, NON-SUBSIDIZED, WM


egen cmt=group(country month treatc)
keep if category=="washing machine"


quietly reghdfe dlogunits i.presub6c##ib1.treatc i.presub5c##ib1.treatc i.presub4c##ib1.treatc i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc i.postsub7c##ib1.treatc i.postsub8c##ib1.treatc i.postsub9c##ib1.treatc i.postsub10c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
gen samples=e(sample)

quietly reghdfe dlogprice i.presub6c##i.treatc i.presub5c##i.treatc i.presub4c##i.treatc i.presub3c##i.treatc i.presub2c##i.treatc i.presub1c##i.treatc i.sub1c##i.treatc i.postsub1c##i.treatc i.postsub2c##i.treatc i.postsub3c##i.treatc i.postsub4c##i.treatc i.postsub5c##i.treatc i.postsub6c##i.treatc i.postsub7c##i.treatc i.postsub8c##i.treatc i.postsub9c##i.treatc i.postsub10c##i.treatc mage mage2  if country!="Hungary"  & samples, absorb (id2 cmt) cluster(id)
est store nonsubp

	nlcom _b[1.presub6c]-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp1
		parmest, format(estimate min95 max95) saving("nsp1.dta", replace) 	idstr(-6)	
		
est restore nonsubp
		nlcom (_b[1.presub6c]+_b[1.presub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp2
		parmest, format(estimate min95 max95) saving("nsp2.dta", replace) 	idstr(-5)	
	
est restore nonsubp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp3
		parmest, format(estimate min95 max95) saving("nsp3.dta", replace) 	idstr(-4)	
		
est restore nonsubp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp4
		parmest, format(estimate min95 max95) saving("nsp4.dta", replace) 	idstr(-3)
		
est restore nonsubp	
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp5
		parmest, format(estimate min95 max95) saving("nsp5.dta", replace) 	idstr(-2)
		
est restore nonsubp
		nlcom (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp6
		parmest, format(estimate min95 max95) saving("nsp6.dta", replace) 	idstr(-1)		
		
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp7
		parmest, format(estimate min95 max95) saving("nsp7.dta", replace) 	idstr(0)		
	
est restore nonsubp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp8
		parmest, format(estimate min95 max95) saving("nsp8.dta", replace) 	idstr(1)		
	
est restore nonsubp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp9
		parmest, format(estimate min95 max95) saving("nsp9.dta", replace) 	idstr(2)		
	
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp10
		parmest, format(estimate min95 max95) saving("nsp10.dta", replace) 	idstr(3)	
		
est restore nonsubp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp11
		parmest, format(estimate min95 max95) saving("nsp11.dta", replace) 	idstr(4)
		
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp12
		parmest, format(estimate min95 max95) saving("nsp12.dta", replace) 	idstr(5)	
		
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp13
		parmest, format(estimate min95 max95) saving("nsp13.dta", replace) 	idstr(6)
	
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp14
		parmest, format(estimate min95 max95) saving("nsp14.dta", replace) 	idstr(7)
		
est restore nonsubp	
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp15
		parmest, format(estimate min95 max95) saving("nsp15.dta", replace) 	idstr(8)
		
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp16
		parmest, format(estimate min95 max95) saving("nsp16.dta", replace) 	idstr(9)
		
est restore nonsubp
		nlcom  (_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]+_b[1.presub2c]+_b[1.presub1c]+_b[1.sub1c]+_b[1.postsub1c]+_b[1.postsub2c]+_b[1.postsub3c]+_b[1.postsub4c]+_b[1.postsub5c]+_b[1.postsub6c]+_b[1.postsub7c]+_b[1.postsub8c]+_b[1.postsub9c]+_b[1.postsub10c])-(_b[1.presub6c]+_b[1.presub5c]+_b[1.presub4c]+_b[1.presub3c]), post
		est store nsp17
		parmest, format(estimate min95 max95) saving("nsp17.dta", replace) 	idstr(10)
						
		
		
	
		
		clear all
		
		use "nsp1.dta"
		append using "nsp2.dta"
		append using "nsp3.dta"
		append using "nsp4.dta"
		append using "nsp5.dta"
		append using "nsp6.dta"
		append using "nsp7.dta"
		append using "nsp8.dta"
		append using "nsp9.dta"	
	    append using "nsp10.dta"
		append using "nsp11.dta"
		append using "nsp12.dta"
		append using "nsp13.dta"
		append using "nsp14.dta"
		append using "nsp15.dta"
		append using "nsp16.dta"
		append using "nsp17.dta"
		
		gen type="nsp"
		gen label="all"
		drop z p parm
		rename idstr month
		save "nsp_6.dta", replace
	
restore	

preserve
clear all
		
		use "s_6.dta"
		append using "ns_6.dta"
		append using "sp_6.dta"
		append using "nsp_6.dta"
		

		gen program="hr15"
		save "HR_2015_Coeff_6.dta", replace

restore

preserve

clear all
		
		use "AT_2009_Coeff_6.dta"
		append using "AT_2010_ff_Coeff_6.dta"
		append using "AT_2010_wm_Coeff_6.dta"
		append using "HU_2015_Coeff_6.dta"
		append using "HU_2016_Coeff_6.dta"
		append using "HR_2015_Coeff_6.dta"
		
		save "Estimates_for_plots_6_new_reference.dta", replace
restore


